<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta charset="UTF-8"/>
		<title>Modification d'un utilisateur</title>
	</head>

	<body>
		<form action="editer.php" method="post">
			<table border="1" width="300">
				<tr>
					<td>Nom</td>
					<td><input type="text" name="nom" id="nom" value="<?php if(isset($user)) echo $user['nom']; ?>"/></td>
				</tr>
				<tr>
					<td>Prénom</td>
					<td><input type="text" name="prenom" id="prenom" value="<?php if(isset($user)) echo $user['prenom']; ?>"/></td>
				</tr>
				<tr>
					<td>Email</td>
					<td><input type="text" name="email" id="email" value="<?php if(isset($user)) echo $user['email']; ?>"/></td>
				</tr>
		
				<tr>
					<td>Password</td>
					<td><input type="password" name="pwd" id="pwd" value=""/></td>
				</tr>
				<tr>
					<td>Confirmation du Password</td>
					<td><input type="password" name="pwd2" id="pwd2" value=""/></td>
				</tr>
				<tr>
				<td>Type</td>
				<td>
					<select id="type" name="type">
						<option value="0">Choisissez un type</option>
						<?php
						
						while( $data = mysqli_fetch_array($resultat)){
							echo "<option value='".$data['id']."'";
							if($data['id'] == $user['id_type']){
								echo " selected = 'selected' ";
							}
							echo ">".$data['libelle']."</option>";
							}
						?>
					</select>
				</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<input type="submit" name="valider" value ="Enregistrer" />
					</td>
				</tr>
			</table>
			<input type="hidden" name="id" value= "<?php echo $id;?>"/>
		</form>

	</body>
</html>












